package com.mxpio.erp.common.inventory.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.mxpio.erp.common.jpa.model.Notice;
import com.mxpio.erp.common.jpa.model.Order;
import com.mxpioframework.security.annotation.Dict;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_INV_WO")
@Schema(description="仓单")
public class WarehouseOrder extends Order {

	private static final long serialVersionUID = 1L;

	@Override
	public String initTypeCode() {
		return "WO1";
	}
	
	@Column(name = "WO_TYPE_")
	@Schema(description = "仓单类型")
	@Dict(dicCode = "ERP_INV_WO_TYPE")
	private String woType;
	
	@Column(name = "ACCESS_TYPE_")
	@Schema(description = "出入类型")
	private String accessType;
	
	@Column(name = "WH_CODE_")
	@Schema(description = "仓库编号")
	@Dict(dicCode = "whCode" ,dicEntity = Warehouse.class, dicText = "whName")
	private String whCode;
	
	@Column(name = "ORIGIN_BIZ_NO_")
	@Schema(description = "来源单号")
	private String originBizNo;
	
	@Column(name = "ORIGIN_BIZ_TYPE_")
	@Schema(description = "来源单据类型")
	@Dict(dicCode = "ERP_INV_WO_TYPE")
	private String originBizType;
	
	@Column(name = "MEMO_")
	@Schema(description = "备注")
	private String memo;
	
	@Transient
	private List<WarehouseOrderLine> warehouseOrderLines;

	@Column(name = "ORIGIN_NOTICE_NO_")
	@Schema(description = "来源通知单单号")
	private String originNoticeNo;

	@Transient
	@Schema(description = "源业务单实体对象")//此处仅处理生产和委外订单，230724 增加采购订单
	private Order order;


	@Transient
	@Schema(description = "源业务单实体对象")//以通知单为起点的业务单（送货计划），
	private Notice notice;

	@Transient
	@Schema(description = "初始化入库实体对象")//材料入库的类型“初始化入库的”对应的初始化入库单据
	private InitStockNotice initStockNotice;

}
